package vip.hamlin.dnspod.bean;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

/**
 * 用来配置请求dnspod所需要的用户信息
 * Created by SunShao on 2016/6/1.
 */
@SuppressWarnings("unused")
@Configuration
@PropertySource("classpath:dnspod_common_config.properties")
public class DNSPodRequestCommonParam extends BaseBean {
    @Value("${currentIPURL}")
    private String currentIPURL;
    @Value("${dnsPodHttpsUrl}")
    private String dnspodHttpsUrl;
    @Value("${login_token}")
    private String loginToken;
    @Value("${login_id}")
    private String loginId;
    @Value("${format}")
    private String format;
    @Value("${lang}")
    private String lang;
    @Value("${error_on_empty}")
    private String errorOnEmpty;
    @Value("${user_id}")
    private String userId;


    public String getLoginToken() {
        return loginToken;
    }

    public void setLoginToken(String loginToken) {
        this.loginToken = loginToken;
    }

    public String getLoginId() {
        return loginId;
    }

    public void setLoginId(String loginId) {
        this.loginId = loginId;
    }

    public String getFormat() {
        return format;
    }

    public void setFormat(String format) {
        this.format = format;
    }

    public String getLang() {
        return lang;
    }

    public void setLang(String lang) {
        this.lang = lang;
    }

    public String getErrorOnEmpty() {
        return errorOnEmpty;
    }

    public void setErrorOnEmpty(String errorOnEmpty) {
        this.errorOnEmpty = errorOnEmpty;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getDnspodHttpsUrl() {
        return this.dnspodHttpsUrl.endsWith("/") ? this.dnspodHttpsUrl : this.dnspodHttpsUrl + "/";
    }

    @SuppressWarnings("unused")
    public void setDnspodHttpsUrl(String dnspodHttpsUrl) {
        this.dnspodHttpsUrl = dnspodHttpsUrl;
    }

    public String getCurrentIPURL() {
        return currentIPURL;
    }

    @SuppressWarnings("unused")
    public void setCurrentIPURL(String currentIPURL) {
        this.currentIPURL = currentIPURL;
    }

    @Override
    public String toString() {
        return "login_token=" + loginId + "," + loginToken +
                "&format=" + format +
                "&lang=" + lang +
                "&error_on_empty=" + errorOnEmpty +
                "&user_id=" + userId;
    }
}
